const express = require("express");
const router = express.Router();

const MySql = require("../lib/mysql");

router.post("/eduDelete",async(req,res,next) => {
    const id = req.body.id;
    const eduDelete = await MySql.query('update education_exp set status =0 where id=?',[id]);
    // const praDelete = await MySql.query('update practice_exp set status =0 where user_id=?',[id]);
    // const proDelete = await MySql.query('update project_exp set status =0 where user_id=?',[id]);
    // const skillsDelete = await MySql.query('update skills set status =0 where user_id=?',[id]);
    // const othersDelete = await MySql.query('update others set status =0 where user_id=?',[id]);
    // const evaluateDelete = await MySql.query('update evaluate set status =0 where user_id=?',[id]);
    res.json({
        code:1,
        message:'edu删除成功'
    })
});
router.post("/praDelete",async(req,res,next) => {
    const id = req.body.id;
    const praDelete = await MySql.query('update practice_exp set status =0 where id=?',[id]);
    res.json({
        code:1,
        message:'praDelete删除成功'
    })
});
router.post("/proDelete",async(req,res,next) => {
    const id = req.body.id;
    const proDelete = await MySql.query('update project_exp set status =0 where id=?',[id]);
    res.json({
        code:1,
        message:'proDelete删除成功'
    })
});
router.post("/honorDelete",async(req,res,next) => {
    const id = req.body.id;
    const honorDelete = await MySql.query('update honor set status =0 where id=?',[id]);
    res.json({
        code:1,
        message:'honorDelte删除成功'
    })
});
// router.post("/skillsDelete",async(req,res,next) => {
//     const id = req.body.id;
//     const skillsDelete = await MySql.query('update skills set status =0 where id=?',[id]);
//     res.json({
//         code:1,
//         message:'skillsDelete删除成功'
//     })
// });
// router.post("/othersDelete",async(req,res,next) => {
//     const id = req.body.id;
//     const othersDelete = await MySql.query('update others set status =0 where id=?',[id]);
//     res.json({
//         code:1,
//         message:'othersDelete删除成功'
//     })
// });
// router.post("/evaluateDelete",async(req,res,next) => {
    // const id = req.body.id;
    // const evaluateDelete = await MySql.query('update evaluate set status =0 where id=?',[id]);
    // res.json({
    //     code:1,
    //     message:'evaluateDelete删除成功'
    // })
// });

module.exports = router;